from presidio_anonymizer import AnonymizerEngine

# 待匿名化的文本
text_with_pii = "John Doe 的电子邮件是 johndoe@example.com，电话号码是123-456-7890。"

# 初始化匿名化引擎
anonymizer = AnonymizerEngine()

# 匿名化文本
anonymized_text1 = anonymizer.anonymize(text=text_with_pii, language='en')
anonymized_text2 = anonymizer.anonymize(text=text_with_pii, language='en')

print("匿名化后的文本:", anonymized_text1)
print("匿名化后的文本:", anonymized_text2)